package hl.demosample.app.network

import hl.demosample.data.model.bean.*
import hl.demosample.data.model.paramsrequest.LoginAndRegisterParamsRequest
import okhttp3.RequestBody
import retrofit2.http.*
import java.util.HashMap

/**
 * 作者　:
 * 时间　:
 * 描述　: 网络API
 * 妹子接口
 * https://gank.io/api
 * Retrofit 动态切换BaseUrl
 * https://github.com/JessYanCoding/RetrofitUrlManager
 * 有好看的App图标记得替换，我这是爬取的wanandroid.com 人家项目里面的图标
 */
interface ApiService {

    companion object {
        const val SERVER_URL = "http://learnsandroid.top:8082/"
        const val SERVER_URL1 = "https://gank.io/api/"
        const val SERVER_URL3 = "https://gank.io/api/v2/"
        const val SERVER_URL4 = "https://wanandroid.com/"
    }

    /****************************************福利接口****************************************/
    /** 福利接口**/
    @GET("data/福利/{size}/{page}")
    suspend fun welfare(@Path("size") size: Int, @Path("page") page: Int): WelfareData

    /*** 本周最热妹子* **/
    @GET("hot/{hot_type}/category/{category}/count/{count}")
    suspend fun weekHot(
        @Path("hot_type") hot_type: String,
        @Path("category") category: String,
        @Path("count") count: Int
    ): GanKApiResponse<ArrayList<WeekHotData>>

    /***分类妹子数据**/
    @GET("data/category/{category}/type/{type}/page/{page}/count/{count}")
    suspend fun girlClassify(
        @Path("category") hot_type: String,
        @Path("type") category: String,
        @Path("page") page: Int,
        @Path("count") count: Int
    ): GirlClassifyData

    /****************************************项目接口****************************************/

    /*** 登录 ***/
    @FormUrlEncoded
    @POST("Lg/user")
    suspend fun login(@Field("mobile")  mobile:String, @Field("password")  pwd:String): ApiResponse<UserInfo>

    /*** 注冊 ***/
    @FormUrlEncoded
    @POST("rgs/user")
    suspend fun register(@FieldMap mobile:HashMap<String,String>): ApiResponse<UserInfo>


}